//
//  WDPBaseScrollView.h
//  WDPubLib
//
//  Created by wujianrong on 16/4/19.
//  Copyright © 2016年 wanda. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "WDPBaseItemView.h"

typedef NS_ENUM(NSInteger, WDPBaseScrollViewDirection) {
    WDPBaseScrollViewDirectionHorizontal = 0,
    WDPBaseScrollViewDirectionVertical = 1  //default
};

@interface WDPBaseScrollView : UIScrollView
/**
 *  是否允许滑动，默认为可滑动的。
 */
@property(nonatomic, assign) BOOL isWDPScrollEnabled;

// view 数据源
@property(nonatomic, copy, readonly) NSArray* itemViewsArray;

// 间距
@property (nonatomic, assign) CGFloat viewSpacing;

/**
 *  上间距
 */
@property (nonatomic,assign) CGFloat wdpMarginUp;

/**
 *  下间距
 */
@property (nonatomic,assign) CGFloat wdpMarginDown;

/**
 左间距
 */
@property (nonatomic,assign) CGFloat wdpMarginLeft;

/**
 右间距
 */
@property (nonatomic,assign) CGFloat wdpMarginRight;

// 方向 default: 
@property (nonatomic) WDPBaseScrollViewDirection direction;

// call back
@property(nonatomic, copy) wdpCallBackBlock callback;

-(instancetype)initWithFrame:(CGRect)frame;

-(void)appendOneItemView:(UIView*)itemView;

-(void)appendOneItemView:(UIView *)itemView atIndex:(NSInteger)index;

-(void)inputWithItemviews:(NSArray*)itemViews;

-(void)removeWithOneItemview:(UIView*)itemView;

-(void)removeOnItemViewWithIndex:(NSInteger)index;

-(void)updateAllItemViews;

-(void)updateAllItemViewsFromSubView:(UIView*)itemView;

- (void)replaceItemAtIndex:(NSInteger)index WithItem:(UIView*)item;

-(void)updateWithDataModel:(id)dataModel callBack:(wdpCallBackBlock)callBack;

- (BOOL)hasItemView:(UIView*)item;

- (void)appendOneItemView:(UIView *)itemView BehindView:(UIView*)behindView atIndex:(NSInteger)index;

- (void)removeAllItemsView;

@end
